<template>
    <div class="navi">
        <van-nav-bar :title="props.title" left-text="返回" :right-text="props.rightText" :fixed="props.fixed" left-arrow
            @click-left="back" @click-right="clickRight">
        </van-nav-bar>
    </div>
</template>

<script  setup lang="ts">
import { defineProps } from 'vue'
import { useRouter } from "vue-router"

import { defineEmits } from 'vue'
const emit = defineEmits(['click-right'])

let router: any = useRouter();

let props = defineProps({
    title: {
        type: String,
        default: ''
    },
    rightText: {
        type: String,
        default: ''
    },
    fixed: {
        type: Boolean,
        default: false
    }

})

let back: () => void = (): void => {
    router.go(-1);
}


let clickRight: () => void = (): void => {
    emit('click-right');

}


</script>


<style lang="less" scoped>
.navi {
    :deep(.van-nav-bar .van-icon) {
        color: #0C34BA;
    }

    :deep(.van-nav-bar__text) {
        color: #0C34BA;
    }
}
</style>
